ERROR_READ_ONLY
ERROR_READ_ONLY = 1
Model class to access an LDAP address directory
$primary_key : string
$groups : bool
$export_groups : bool
$readonly : bool
$searchonly : bool
$undelete : bool
$ready : bool
$group_id : null|string|int
$list_page : int
$page_size : int
$sort_col : string
$sort_order : string
$date_cols : string[]
$coltypes : array
$vcard_map : string[]
$error : ?array
$group_types : array
Group objectclass (lowercase) to member attribute mapping
list_records(array $cols = null, int $subset, bool $nocount = false) : array
List the current set of contact records
array | $cols | List of cols to show |
int | $subset | Only return this number of records |
bool | $nocount | True to skip the count query (Not used) |
Indexed list of contact records, each a hash array
search(mixed $fields, mixed $value, int $mode, bool $select = true, bool $nocount = false, array $required = []) : \rcube_result_set
Search contacts
mixed | $fields | The field name of array of field names to search in |
mixed | $value | Search value (or array of values when $fields is array) |
int | $mode | Matching mode. Sum of rcube_addressbook::SEARCH_* |
bool | $select | True if results are requested, False if count only |
bool | $nocount | (Not used) |
array | $required | List of fields that cannot be empty |
List of contact records
validate(array $save_data, bool $autofix = false) : bool
Check the given data before saving.
If input not valid, the message to display can be fetched using get_error()
array | $save_data | Associative array with data to save |
bool | $autofix | Try to fix/complete record automatically |
True if input is valid, False if not.
insert(array $save_cols, bool $check = false) : mixed
Create a new contact record
array | $save_cols | Associative array with save data Keys: Field name with optional section in the form FIELD:SECTION Values: Field value. Can be either a string or an array of strings for multiple values |
bool | $check | True to check for duplicates first |
The created record ID on success, False on error
list_groups(string $search = null, int $mode) : array
List all active contact groups of this source
string | $search | Optional search string to match group name |
int | $mode | Matching mode. Sum of rcube_addressbook::SEARCH_* |
Indexed list of contact groups, each a hash array
rename_group(string $group_id, string $new_name, string $new_gid) : bool
Rename a specific contact group
string | $group_id | Group identifier |
string | $new_name | New name to set for this group |
string | $new_gid | New group identifier (if changed, otherwise don't set) |
New name on success, false if no data was changed
remove_from_group(string $group_id, array|string $contact_ids) : int
Remove the given contact records from a certain group
string | $group_id | Group identifier |
array|string | $contact_ids | List of contact identifiers to be removed |
Number of deleted group members
get_col_values(string $col, array $data, bool $flat = false) : array
Utility function to return all values of a certain data column either as flat list or grouped by subtype
string | $col | Col name |
array | $data | Record data array as used for saving |
bool | $flat | True to return one array with all values, False for hash array with values grouped by type |
List of column values
compose_display_name(array $contact, bool $full_email = false) : string
Compose a valid display name from the given structured contact data
array | $contact | Hash array with contact data as key-value pairs |
bool | $full_email | Don't attempt to extract components from the email address |
Display name
compose_list_name(array $contact) : string
Compose the name to display in the contacts list for the given contact record.
This respects the settings parameter how to list contacts.
array | $contact | Hash array with contact data as key-value pairs |
List name
compose_search_name(array $contact, string $email = null, string $name = null, string $templ = null) : string
Build contact display name for autocomplete listing
array | $contact | Hash array with contact data as key-value pairs |
string | Optional email address |
|
string | $name | Optional name (self::compose_list_name() result) |
string | $templ | Optional template to use (defaults to the 'contact_search_name' config option) |
Display name
compare_search_value(string $colname, string|array $value, string $search, int $mode) : bool
Compare search value with contact data
string | $colname | Data name |
string|array | $value | Data value |
string | $search | Search value |
int | $mode | Search mode |
Comparison result
extended_search(bool $count = false) : int|array
Wrapper on LDAP searches with group_filters support, which allows searching for contacts AND groups.
bool | $count | Return count instead of the records |
Count of records or the result array (with 'count' item)
_list_group_members(string $dn, array $entry, string $attr, bool $count) : array
Fetch members of the given group entry from server
string | $dn | Group DN |
array | $entry | Group entry |
string | $attr | Member attribute to use |
bool | $count | Count only |
Accumulated group members